package bean;

public class KnnNode implements Comparable<KnnNode> {
    private double knnDis;
    private int num;

    public KnnNode() {
        super();
    }

    public KnnNode(double knnDis, int num) {
        super();
        this.knnDis = knnDis;
        this.num = num;
    }

    public double getKnnDis() {
        return knnDis;
    }

    public void setKnnDis(double knnDis) {
        this.knnDis = knnDis;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    public int compareTo(KnnNode o) {
        double sub = this.getKnnDis() - o.getKnnDis();
        if (sub == 0) {
            return 0;
        } else if (sub < 0) {
            return -1;
        } else {
            return 1;
        }
    }
}
